/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fix.it.source.fixit;

import java.io.Serializable;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;

/**
 *
 * @author Aleksandra
 */
//@Named("problem")
//@RequestScoped
@ManagedBean(name="problem")
@SessionScoped
public class ProblemListPresenter implements Serializable{
    @Inject ProblemBean pb;
    private long selectedid;
    private Problem selectedProblem;

    public long getSelectedid() {
        return this.selectedid;
    }

    public void setSelectedid(long selectedid) {
        this.selectedid = selectedid;
    }
    
    public List<Problem> getListProblems()
    {
        return pb.getProblemList();
    
    }
    public Problem getSelectedProblem()
    {
        return pb.getSelectedProblem();
    }
    public void setSelectedProblem(Problem selectedProblem){
    
        pb.setSelectedProblem(selectedProblem);
    }
    public String outcome(){
        pb.setSelectedProblem(pb.getProblem(selectedid));
	return "ProblemDetails";
    }
    public String backToList(){
        
		return "ReportedProblems";
	}
    
    
}
